package com.bkhech.home.practice.spring.el.bean_ref;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * EL bean 引用
 *
 * @author guowm
 * @date 2023/1/16
 */
public class ElApplicationDemo {

    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
        System.out.println(context.getBean("annotationBean", AnnotationBean.class));

        //In Spring EL, you can reference a bean, and nested properties
        // using a ‘dot (.)‘ symbol. For example, “bean.property_name“.
        System.out.println(context.getBean("elBeanReference", ElBeanReference.class));

    }
}
